<?php

App::uses('AppController', 'Controller');

class UsersController extends AppController {
	
	public $models = array('User');
	
	public function login() {
		$this->layout = 'login';
		
		if($this->request->is('post')) {
			if(!$this->Auth->login()) {
				$this->Session->setFlash(__('Login failed'));
			}else{
				$this->redirect($this->Auth->redirect());
			}
		}
	}
	
	public function logout() {
		$this->redirect($this->Auth->logout());
	}
	
}